<template>
  <div class="comments-container">
    <h1>评论管理</h1>
    <n-card>
      <n-data-table
        :columns="columns"
        :data="data"
        :pagination="pagination"
      />
    </n-card>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { NCard, NDataTable } from 'naive-ui'
import { getCommentsList } from '@/api'

const columns = [
  { title: 'ID', key: 'id' },
  { title: '内容', key: 'content' },
  { title: '状态', key: 'status' },
  { title: '创建时间', key: 'createTime' }
]

const data = ref([])
const pagination = { pageSize: 10 }

getCommentsList().then(res => {
  data.value = res.data.list
})
</script>

<style scoped>
.comments-container {
  padding: 20px;
}
</style>